const app = getApp()	
Page({


 
  data: {
    devices:[{
     show:false
    }],
  },
  
  showPopup() {
    this.setData({ show: true });
  },

  onClose() {
    this.setData({ show: false });
  },
  onPullDownRefresh(){
    wx.request({
      url: 'http://47.115.152.5:8080/devices/list.do',
      success: (result) => {
       
        this.setData({
          devices:result.data.data
        })
        console.log(this.devices);
      },
      fail: (res) => {},
      complete: (res) => {},
    })
  },

  get_decives(){
    wx.request({
      url: 'http://47.115.152.5:8080/devices/list.do',
      success: (result) => {
        console.log(result.data.data);
      },
      fail: (res) => {},
      complete: (res) => {},
    })
  },
  onShow: function () {
    this.getTabBar().init();
  },
  onLoad: function (options) { 

    wx.request({
      url: 'http://47.115.152.5:8080/devices/list.do',
      success: (result) => {
       
        this.setData({
          devices:result.data.data
        })
        console.log(this.devices);
      },
      fail: (res) => {},
      complete: (res) => {},
    })
   /*
    wx.getUserInfo({
      success:function(res){
        if(res.detail){
          const {userInfo}=res.detail;//不加判断就会出错  es6解构赋值  获取用户信息
        console.log(userInfo);
        wx.setStorageSync('userinfo', userInfo);
        }
        
      }
    })*/
  },

  
})